1 Transects

Plant Flowers Date lon lat ele Month Year julian
Glossoloma oblongicalyx 4 2015-10-19 -78.59093 0.130838 2270 October 2015 292
Gasteranthus quitensis 2 2016-10-17 -78.59770 0.120070 1940 October 2016 291
Kohleria affinis 1 2016-12-13 -78.59534 0.126746 2110 December 2016 348
Columnea ciliata 3 2014-02-27 -78.59934 0.116682 1960 February 2014 58
Columnea medicinalis 1 2014-04-23 -78.59372 0.128700 2130 April 2014 113
Drymonia teuscheri 3 2016-07-28 -78.59245 0.129393 2200 July 2016 210

2 Phylogeny

3 Traits

Plant Flowers Date lon lat ele Month Year julian
Glossoloma oblongicalyx 4 2015-10-19 -78.59093 0.130838 2270 October 2015 292
Gasteranthus quitensis 2 2016-10-17 -78.59770 0.120070 1940 October 2016 291
Kohleria affinis 1 2016-12-13 -78.59534 0.126746 2110 December 2016 348
Columnea ciliata 3 2014-02-27 -78.59934 0.116682 1960 February 2014 58
Columnea medicinalis 1 2014-04-23 -78.59372 0.128700 2130 April 2014 113
Drymonia teuscheri 3 2016-07-28 -78.59245 0.129393 2200 July 2016 210

3.0.1 Total Flowers

Peak date

4 Count model of species phenology

4.1 Infer absences

4.2 Julian Day

## sink("model/julian.jags")
## cat("
##     model {
##     
##     for (x in 1:Nobs){
##     
##     #observation
##     log(phi[x])<-alpha[Plant[x]]  + beta[Plant[x]] * julian[x] + beta2[Plant[x]] * julian[x]^2
##     
##     Yobs[x] ~ dpois(phi[x])
##     
##     }
##     
## 
##     #Assess Model Fit
##     #Priors
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##       #Intercept
##       #poisson regression prior
##       beta[j] ~ dnorm(0,0.0001)
##       beta2[j] ~ dnorm(0,0.0001)
##       alpha[j] ~ dnorm(0,0.0001)
##     } 
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 4267
##    Unobserved stochastic nodes: 51
##    Total graph size: 25691
## 
## Initializing model

5 Get Chains

5.0.1 Evaluate convergence

5.0.2 Posterior estimates

5.0.3 Effect of Julian day

6 Phylogeny

6.1 Julian + Phylogenetic Attraction

## sink("model/julian_decay.jags")
## cat("
##     model {
##     
##     #observation - species specific intercept and phylogenetic covariance in julian day
##     
##     for (x in 1:Nobs){
##     
##     log(phi[x])<- alpha[Plant[x]]  + beta[Plant[x]] * julian[x] + beta2[Plant[x]] * julian[x]^2
##     
##     Yobs[x] ~ dpois(phi[x])
##     
##     }
##     
##     #species-specific responses to julian day. Polynomial model.
##     #autocorrelation in error
##     beta[1:Plants] ~ dmnorm(beta.mu[],tauC[,])
##     beta2[1:Plants] ~ dmnorm(beta2.mu[],tauC2[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##       for(j in 1:Plants){
##         C[i,j] = exp(-lambda * D[i,j])
##       }
##     }
##     
##     ## Since the response to julian is X^2 polynomial, need covariance effects on both terms.
##     ## These terms share everything except for the scaling factor sigma. The decay of effect is the same. 
##     ## covert variance to precision for each parameter
##     
##     iC=inverse(C[,])
## 
##     tauC=iC
##     tauC2=iC
##     
##     ## **************************
##     ##         Priors
##     ## **************************
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #Intercept
##     beta.mu[j] ~ dnorm(0,0.0001)
##     beta2.mu[j] ~ dnorm(0,0.0001)
##     alpha[j] ~ dnorm(0,0.0001)
##     } 
##     
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
##     
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 3514
##    Unobserved stochastic nodes: 45
##    Total graph size: 21452
## 
## Initializing model

7 Get Chains

7.0.1 Evaluate convergence

7.0.2 Posterior estimates

7.0.3 Effect of Julian day

7.1 Decay in phylogenetic effect

7.2 Julian + Phylogenetic Repulsion

## sink("model/julian_decay_repulse.jags")
## cat("
##     model {
##     
##     #observation - species specific intercept and phylogenetic covariance in julian day
##     
##     for (x in 1:Nobs){
##     
##     log(phi[x])<- alpha[Plant[x]]  + beta[Plant[x]] * julian[x] + beta2[Plant[x]] * julian[x]^2
##     
##     Yobs[x] ~ dpois(phi[x])
##     
##     }
##     
##     #species-specific responses to julian day. Polynomial model.
##     #autocorrelation in error
##     beta[1:Plants] ~ dmnorm(beta.mu[],tauC[,])
##     beta2[1:Plants] ~ dmnorm(beta2.mu[],tauC2[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##     for(j in 1:Plants){
##     C[i,j] = exp(-lambda * D[i,j])
##     }
##     }
## 
##     #Inverse matrix correlation for repulsion - see Ives and Helmus 2011
##     #For clarity sake this is performed, even though it is undone by converting to precision
##     iC=inverse(C[,])
##     
##     ## Since the response to julian is X^2 polynomial, need covariance effects on both terms.
##     ## These terms share everything except for the scaling factor sigma. The decay of effect is the same. 
##     ## covert variance to precision for each parameter
##     
##     tauC[1:Plants,1:Plants]=iC
##     tauC2[1:Plants,1:Plants]=iC
##     
##     ## **************************
##     ##         Priors
##     ## **************************
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #Intercept
##     beta.mu[j] ~ dnorm(0,0.0001)
##     beta2.mu[j] ~ dnorm(0,0.0001)
##     alpha[j] ~ dnorm(0,0.0001)
##     } 
##     
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
##     
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 3514
##    Unobserved stochastic nodes: 45
##    Total graph size: 21452
## 
## Initializing model

8 Get Chains

8.0.1 Evaluate convergence

8.0.2 Posterior estimates

8.0.3 Effect of Julian day

8.1 Decay in phylogenetic effect

9 Traits

9.1 Julian + Trait Attraction

## sink("model/julian_decay.jags")
## cat("
##     model {
##     
##     #observation - species specific intercept and phylogenetic covariance in julian day
##     
##     for (x in 1:Nobs){
##     
##     log(phi[x])<- alpha[Plant[x]]  + beta[Plant[x]] * julian[x] + beta2[Plant[x]] * julian[x]^2
##     
##     Yobs[x] ~ dpois(phi[x])
##     
##     }
##     
##     #species-specific responses to julian day. Polynomial model.
##     #autocorrelation in error
##     beta[1:Plants] ~ dmnorm(beta.mu[],tauC[,])
##     beta2[1:Plants] ~ dmnorm(beta2.mu[],tauC2[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##       for(j in 1:Plants){
##         C[i,j] = exp(-lambda * D[i,j])
##       }
##     }
##     
##     ## Since the response to julian is X^2 polynomial, need covariance effects on both terms.
##     ## These terms share everything except for the scaling factor sigma. The decay of effect is the same. 
##     ## covert variance to precision for each parameter
##     
##     iC=inverse(C[,])
## 
##     tauC=iC
##     tauC2=iC
##     
##     ## **************************
##     ##         Priors
##     ## **************************
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #Intercept
##     beta.mu[j] ~ dnorm(0,0.0001)
##     beta2.mu[j] ~ dnorm(0,0.0001)
##     alpha[j] ~ dnorm(0,0.0001)
##     } 
##     
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
##     
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 3765
##    Unobserved stochastic nodes: 48
##    Total graph size: 23167
## 
## Initializing model

10 Get Chains

10.0.1 Evaluate convergence

10.0.2 Posterior estimates

10.0.3 Effect of Julian day

10.1 Decay in trait effect

10.2 Julian + Trait Repulsion

## sink("model/julian_decay_repulse.jags")
## cat("
##     model {
##     
##     #observation - species specific intercept and phylogenetic covariance in julian day
##     
##     for (x in 1:Nobs){
##     
##     log(phi[x])<- alpha[Plant[x]]  + beta[Plant[x]] * julian[x] + beta2[Plant[x]] * julian[x]^2
##     
##     Yobs[x] ~ dpois(phi[x])
##     
##     }
##     
##     #species-specific responses to julian day. Polynomial model.
##     #autocorrelation in error
##     beta[1:Plants] ~ dmnorm(beta.mu[],tauC[,])
##     beta2[1:Plants] ~ dmnorm(beta2.mu[],tauC2[,])
##     
##     ##covariance among similiar species
##     for(i in 1:Plants){
##     for(j in 1:Plants){
##     C[i,j] = exp(-lambda * D[i,j])
##     }
##     }
## 
##     #Inverse matrix correlation for repulsion - see Ives and Helmus 2011
##     #For clarity sake this is performed, even though it is undone by converting to precision
##     iC=inverse(C[,])
##     
##     ## Since the response to julian is X^2 polynomial, need covariance effects on both terms.
##     ## These terms share everything except for the scaling factor sigma. The decay of effect is the same. 
##     ## covert variance to precision for each parameter
##     
##     tauC[1:Plants,1:Plants]=iC
##     tauC2[1:Plants,1:Plants]=iC
##     
##     ## **************************
##     ##         Priors
##     ## **************************
##     
##     #Species level priors
##     
##     for (j in 1:Plants){
##     
##     #Intercept
##     beta.mu[j] ~ dnorm(0,0.0001)
##     beta2.mu[j] ~ dnorm(0,0.0001)
##     alpha[j] ~ dnorm(0,0.0001)
##     } 
##     
##     #Strength of covariance decay
##     lambda ~ dunif(0,5)
##     
##     
##     }
##     ",fill=TRUE)
## 
## sink()
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 3765
##    Unobserved stochastic nodes: 48
##    Total graph size: 23167
## 
## Initializing model

11 Get Chains

11.0.1 Evaluate convergence

11.0.2 Posterior estimates

11.0.3 Effect of Julian day

11.1 Decay in trait effect

12 Model Comparison

12.1 Effect of julian day

12.2 Decay in phylogenetic effect

13 Model Fit

13.1 Overall

13.2 By Species

14 Prediction

Todo